package anime.play.room;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import anime.play.room.AnimePlayHistoryModel;

import anime.room.HistoryDao;
import anime.room.HistoryDataBase;

@Database(entities = {AnimePlayHistoryModel.class}, version = 1, exportSchema = false)
public abstract class AnimePlayHistoryDataBase extends RoomDatabase {
    private static AnimePlayHistoryDataBase mInstance;
    private static final String  DATABASE_NAME ="animeplayhistorys_db.db";

    public static synchronized AnimePlayHistoryDataBase getInstance(Context context){
        if(mInstance==null){
            mInstance = Room.databaseBuilder(context.getApplicationContext(),
                    AnimePlayHistoryDataBase.class,
                    DATABASE_NAME)
                    .build();
        }
        return mInstance;
    }

    public abstract AnimePlayHistoryDao getStudentDao();
}
